package com.aierjun.notepad;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;

/**
 * Created by aierJun on 2016/6/18.
 */
public class NewListActivity extends AppCompatActivity {

    protected ImageView add_1;
    protected ImageView add_2;
    protected ImageView add_3;
    protected ImageView add_4;

    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_form_list);
        findView();
        initView();
    }

    protected void findView() {
        add_1 = (ImageView) findViewById(R.id.add_1);
        add_2 = (ImageView) findViewById(R.id.add_2);
        add_3 = (ImageView) findViewById(R.id.add_3);
        add_4 = (ImageView) findViewById(R.id.add_4);
    }

    protected void initView() {

        add_1.setOnClickListener(onClickListener);
        add_2.setOnClickListener(onClickListener);
        add_3.setOnClickListener(onClickListener);
        add_4.setOnClickListener(onClickListener);
    }

    private View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            switch (view.getId()) {
                case R.id.add_1:
                    startActivity(new Intent(NewListActivity.this, NewTextActivity.class));
                    break;
                case R.id.add_2:
                    startActivity(new Intent(NewListActivity.this, NewEmailActivity.class));
                    break;
                case R.id.add_3:
                    startActivity(new Intent(NewListActivity.this, NewImageActivity.class));
                    break;
                case R.id.add_4:
                    startActivity(new Intent(NewListActivity.this, NewHttpActivity.class));
                    break;
            }
        }
    };
}
